<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入在线的leaflet依赖 -->
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css"
        integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" crossorigin="" />
    <script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"
        integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" crossorigin=""></script>
    <!-- js依赖 -->
    <!-- <script src="https://lib.baomitu.com/leaflet/1.9.2/leaflet.js"></script> -->
    <!-- css依赖 -->
    <!-- <link rel="stylesheet" href="https://lib.baomitu.com/leaflet/1.9.2/leaflet.css"> -->
    <!--鹰眼控件样式-->
    <!-- <link href="../../libs/leaflet/plugins/Leaflet-MiniMap-master/src/Control.MiniMap.css" rel="stylesheet" /> -->
    <!--鹰眼控件扩展库-->
    <!-- <script src="../../libs/leaflet/plugins/Leaflet-MiniMap-master/src/Control.MiniMap.js"></script> -->
    <link href="https://cdn.bootcdn.net/ajax/libs/leaflet-minimap/3.6.1/Control.MiniMap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcdn.net/ajax/libs/leaflet-minimap/3.6.1/Control.MiniMap.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        #map {
            height: 100vh;
        }
    </style>
</head>

<body>
    <div id="map"></div>
    <script>
        var url = 'https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoiY2hlbmdiZW5jaGFvIiwiYSI6ImNsODU3aGRiODA0Y2UzcHBzZmFlcmdqZ2sifQ.8k59W_pB_Riwe6o-MneRlA'
        var layer = L.tileLayer(url, {
            maxZoom: 19,
            attribution: '© OpenStreetMap'
        })
        const map = L.map("map", {
            center: [0, 0],
            zoom: 1,
            layers: [layer]
        })
        //OSM地图
        var TianDiTu2 = new L.TileLayer(url, {
            //最小显示等级
            minZoom: 1,
            //最大显示等级
            maxZoom: 15,
            //设置地图不连续显示
            noWrap: true
        });
        //添加鹰眼地图
        var miniMap = new L.Control.MiniMap(TianDiTu2, {
            //鹰眼按钮是否显示
            toggleDisplay: true
        }).addTo(map);
    </script>
</body>

</html>